import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';//忘了这个
// import "@/assets/fonts/style.css";/*引入字体样式 */
import "@/assets/fonts/iconfont.css";/*引入字体样式 */
import "@/assets/global.css"//引入全局样式
import axios from 'axios'
import VueQuillEditor from 'vue-quill-editor' //导入富文本编辑器 下为对应样式
import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme
//进度条包的导入
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

Vue.use(VueQuillEditor, /* { default global options } */)
Vue.config.productionTip = false
// axios.defaults.baseURL = 'https://www.liulongbin.top:8888/api/private/v1/';//网络接口
//http://timemeetyou.com:8889/api/private/v1/  备用网络接口
axios.defaults.baseURL = 'http://timemeetyou.com:8889/api/private/v1/'
// axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'              //本地接口

//request拦截器中展示进度条
axios.interceptors.request.use(config =>{
  // console.log(config);
  NProgress.start()
  config.headers.Authorization = window.sessionStorage.getItem('token')
  //最后必须return config
  return config
})
//response拦截器中隐藏进度条
axios.interceptors.response.use(config =>{
  NProgress.done()
  return config
})

Vue.prototype.$http = axios;
Vue.use(ElementUI);
Vue.filter('dateFormat',function(originVal){
  const dt = new Date(originVal)

  const y = dt.getFullYear()
  const m = (dt.getMonth() + 1 + '').padStart(2,'0')
  const d = (dt.getDate() + '').padStart(2,'0')
  const hh = (dt.getHours() + '').padStart(2,'0')
  const mm = (dt.getMinutes() + '').padStart(2,'0')
  const ss = (dt.getSeconds() + '').padStart(2,'0')

  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
